/*
 *@# FlashLink Created on 2004-7-23
 *
 *
 * Copyright: Bluejay Networks Inc. & Inquiry Management Systems Ltd.  2004
 *
 * This software is the proprietary information of Bluejay Networks Inc. & 
 * Inquiry Management Systems Ltd.  
 * Use is subject to license terms.
 */
package com.ims.iaa.AD;

import com.ims.iaa.IaaDebug; 
/** 
*
* An <code>AdFlash</code> object represents the object wrapper of the flash 
* data that ad spiders had collected.
*
* @see SpiderDBConnection
*
* @author ShengMeng Bai
*
* @version 1.00, 23 JUL. 2004
*/
public class AdFlash extends AdData {
	/**
	  * Flag indicates save flash data or not. Default is true. 
	  * Used by FlashLink when connected to the actual flash on the web.
	  *
	  * @see FlashLink#connectToResource
	  */
	static public final boolean SAVEFLASH = true;

	/**
	  * Flag specifies the max flash size. Default is 100k. 
	  * Used by FlashLink when connected to the actual flash on the web.
	  *
	  * @see FlashLink#connectToResource
	  */
	static public final int MAXFLASHSIZE = IaaDebug.MaxFlashSize;
	
	/**
	 * some flash cann't be get the width and height, so use the 
	 * default width and height, they be set in construtor.
	 * @see #AdFlash
	 */
	static private final int DEFAULT_FLASH_WIDTH = 200;
	static private final int DEFAULT_FLASH_HEIGHT = 100;
	/**The position of Flash Player ActiveX, if the web page explorer cann't find the flash player,
	 *it will automatically download accodrding to this codebase.
	 */
	private String m_sCodeBase = ""; 

	//++Add by ShengMengBai at 2005-04-01
	//after we parse the flash URL, we need save it to, so we can get it from database, don't need re-parse it
	private String m_sFlashURL;
	private String m_sFlashURLVar;
	private boolean m_bRefreshDB;
	public boolean needSaveFlashURL(){
	    return m_bRefreshDB;
	}
	public void setURLUnsavedFlag(){
	    m_bRefreshDB = true;
	}
	/**
	 * After parse the flash URL, set it, and also can get from database.
	 * @param sFlashURL
	 */
	public void setFlashURL(String sFlashURL){
	    m_sFlashURL = sFlashURL;
	}
	public String getFlashURL(){
		return m_sFlashURL;
	}
	public boolean hasFlashURL(){
	    return m_sFlashURL != null;
	}
	/**
	 * After parse the flash URL var, set it, and also can get from database.
	 * @param sFlashURLVar
	 */
	public void setFlashURLVar( String sFlashURLVar ){
	    m_sFlashURLVar = sFlashURLVar;
	}
	public String getFlashURLVar(){
		return m_sFlashURLVar;
	}
	public boolean hasFlashURLVar(){
	    return m_sFlashURLVar != null;
	}
	//--Add by ShengMengBai at 2005-04-01
	
	public AdFlash(){
		setWidth(DEFAULT_FLASH_WIDTH);
		setHeight(DEFAULT_FLASH_HEIGHT);
	}
	
	/**
	 * Set the position of Flash Player ActiveX.
	 * such as:"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
	 * @param sCodeBase the position of Flash Player ActiveX.
	 */
	public void setCodeBase( String sCodeBase ){
		m_sCodeBase = sCodeBase;
	}
	/**
	 * The method override the method of super class
	 * Get the position of Flash Player ActiveX.
	 * @return the String of the position of Flash Player ActiveX.
	 */
	public String getCodeBase(){
		return m_sCodeBase;
	}
}
